//
//  ViewController.m
//  myfirstapp
//
//  Created by iGxnon on 2021/11/15.
//

#import "ViewController.h"
#import "UITableTestViewController.h"
#import "LoginViewController.h"

@interface ViewController ()

@property (weak, nonatomic) IBOutlet UIButton *LoginViewBtn;

@property (weak, nonatomic) IBOutlet UIButton *UITableViewBtn;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.LoginViewBtn addTarget:self action:@selector(checkOutToLoginView:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.UITableViewBtn addTarget:self action:@selector(checkOutToLoginUITableTest:) forControlEvents:UIControlEventTouchUpInside];

}

- (void)checkOutToLoginView: (UIButton *) btn {
    LoginViewController *login = [[LoginViewController alloc] init];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:login];
    self.view.window.rootViewController = nav;
    [self.view.window makeKeyAndVisible];
    [self.navigationController pushViewController:login animated:YES];
    
}


- (void)checkOutToLoginUITableTest: (UIButton *) btn {
    UITableTestViewController *table = [[UITableTestViewController alloc] init];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:table];
    self.view.window.rootViewController = nav;
    [self.view.window makeKeyAndVisible];
    [self.navigationController pushViewController:table animated:YES];
    
}



@end
